#include <iostream>
using namespace std;

int main()
{
	long long m;
	int k;
	cin >> m >> k;
	int c = 0;
	long long tmp = m;
	while(tmp)
	{
		if(tmp%10 == 3)
		c++;
		tmp/=10;
	}
     if(c == k)
     cout<<"YES";
     else
     cout << "NO";
   		
}

